package com.flyu.myGui.myCalculator;

import javax.swing.*;
import java.awt.*;

public class CalcuPanel extends JPanel {
    TextField num1, num2, num3;

    public CalcuPanel() {
        LoadPanel();
    }

    public void LoadPanel(){
        num1 = new TextField(10);
        num2 = new TextField(10);
        num3 = new TextField(10);

        // 一个按钮
        Button button = new Button("=");
        // 添加监听事件
        button.addActionListener(new MyListener(this));

        // 一个标签
        Label label = new Label("+");

        this.add(num1);
        this.add(label);
        this.add(num2);
        this.add(button);
        this.add(num3);

    }
}
